import java.time.LocalDate;
import java.time.format.DateTimeFormatter;
import java.time.format.DateTimeParseException;
import java.time.temporal.ChronoUnit;
import java.util.Scanner;

public class id {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入一个日期（格式：yyyy-MM-dd）：");
                                                                                                                                                                          String inputDate = scanner.nextLine();
        DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyy-MM-dd");
        LocalDate date;
        try {
            date = LocalDate.parse(inputDate, formatter);
        } catch (DateTimeParseException e) {
            System.out.println("输入的日期格式不正确或无效，请重新输入。");
            return;
        }
        LocalDate currentDate = LocalDate.now();
        long daysBetween = ChronoUnit.DAYS.between(date, currentDate);
        if (daysBetween < 0) {
            System.out.println("输入的日期在当前日期之后，请重新输入。");
        } else {
            System.out.println("从输入的日期到现在过去了 " + daysBetween + " 天。");
        }
    }
}
